package com.finance;

import com.finance.service.FinanceDataSyncService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class Task {
    FinanceDataSyncService financeDataSyncService;

//    @Scheduled(cron = "0 30 6 * * ?") // Run at 1 AM every day
    @Scheduled(cron = "${schedules.cron}")
    public void syncAllData() {
        String searchDate = "2025-02-03";
        financeDataSyncService.syncDataByDate(searchDate,false);
    }
}
